//
//  AdddUserViewController.m
//  PostMessa
//
//  Created by never down on 15-5-24.
//  Copyright (c) 2015年 ygy_ios. All rights reserved.
//

#import "AdddUserViewController.h"

@interface AdddUserViewController ()
@property (weak, nonatomic) IBOutlet UITextField *uid;
@property (weak, nonatomic) IBOutlet UITextField *sex;
@property (weak, nonatomic) IBOutlet UITextField *age;
@property (weak, nonatomic) IBOutlet UITextField *name;

@property (weak, nonatomic) IBOutlet UITextField *role;
@property (weak, nonatomic) IBOutlet UITextField *tel;

@property (weak, nonatomic) IBOutlet UITextField *rank;

@property (weak, nonatomic) IBOutlet UITextField *imgaeVal;


@property (weak, nonatomic) IBOutlet UIButton *backBtn;
@property (weak, nonatomic) IBOutlet UIButton *SubBtn;

@end

@implementation AdddUserViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
//    [[NSBundle mainBundle] initWithPath:];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchesBegan:)];
    [self.view addGestureRecognizer:tap];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - listener

- (void)touchesBegan:(id)sender {
    [self.view endEditing:YES];
}

- (IBAction)touchBackToHome:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (IBAction)touchSubToHome:(id)sender {
    NSMutableArray *valArray = [[NSMutableArray alloc] initWithCapacity:7];
    [valArray addObject:self.uid.text];
    [valArray addObject:self.sex.text];
    [valArray addObject:self.age.text];
    [valArray addObject:self.name.text];
    [valArray addObject:self.role.text];
    [valArray addObject:self.tel.text];
    [valArray addObject:self.rank.text];
    [valArray addObject:self.imgaeVal.text];
    NSLog(@"%@",valArray);
    if(self.block){
        self.block(valArray);
    }
    [self dismissViewControllerAnimated:YES completion:nil];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
